package cn.com.bluemoon.daps.model.core.file.transformer;

import java.util.List;
import java.util.stream.Collectors;

/**
 * 转换器，
 * @param <T>
 * @param <R>
 */
@FunctionalInterface
public interface Transformer<T, R> {
    public R transform(T t);

    default List<R> transform(List<T> ts) {
        return ts.stream().map(t -> transform(t)).collect(Collectors.toList());
    }

}
